<%@ page contentType="text/html;charset=UTF-8"%>
 <%@page import="java.util.Vector"%>
<%@ include file="../include/jsp/head.jsp"%>
<% 
Vector<String[]> vctObj=new Vector<String[]>();
String temp1[] = new String[3];
temp1[0]="1";
temp1[1]="张三";
temp1[2]="男";
vctObj.add(temp1); 
temp1[0]="2";
temp1[1]="里斯";
temp1[2]="男";
vctObj.add(temp1); 
temp1[0]="3";
temp1[1]="王五";     
temp1[2]="女";
vctObj.add(temp1); 
StringBuffer sb = new StringBuffer();
sb.append("编号,姓名,性别\n");
if (vctObj.size() != 0)
{
	for (int i = 0; i < vctObj.size(); i++)
	{
		sb.append(vctObj.get(i)[0] + "," +  vctObj.get(i)[1]+ ","+  vctObj.get(i)[2]+"\n");
	}
}
String strFileName = "CSV文件导出例子.csv";
response.setContentType("APPLICATION/*");
response.setHeader( "Content-Disposition", "attachment;filename="  + new String( strFileName.getBytes("gbk"), "ISO8859-1" ));
ServletOutputStream output = response.getOutputStream();
output.write(sb.toString().getBytes());
%>